package com.buss.admin.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * @Title: Entity
 * @Description: 后台
 * @author zhangdaihao
 * @date 2016-04-09 10:07:44
 * @version V1.0
 *
 */
@Entity
@Table(name = "hx_role_function", schema = "")
@DynamicUpdate(true)
@DynamicInsert(true)
@SuppressWarnings("serial")
public class RoleFunctionEntity implements java.io.Serializable {

	private String id;

	private AuthRoleEntity role;
	private AuthFunctionEntity functionEntity;

	@Id
	// @GeneratedValue(generator = "paymentableGenerator")
	// @GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
	@Column(name = "ID", nullable = false, length = 32)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY) // ManyToOne关联到GoodsEntity
	@JoinColumn(name = "ROLE_ID")
	public AuthRoleEntity getRole() {
		return role;
	}

	public void setRole(AuthRoleEntity role) {
		this.role = role;
	}

	@ManyToOne(fetch = FetchType.LAZY) // ManyToOne关联到GoodsEntity
	@JoinColumn(name = "FUNCTION_ID")
	public AuthFunctionEntity getFunctionEntity() {
		return this.functionEntity;
	}

	public void setFunctionEntity(AuthFunctionEntity functionEntity) {
		this.functionEntity = functionEntity;
	}
}
